package cn.jinjimi.app.main.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import cn.jinjimi.app.R;
import cn.jinjimi.app.bean.Constants;
import cn.jinjimi.app.main.extend.BaseActivity;
import cn.jinjimi.app.main.extend.ToolBarCommonActivity;
import cn.jinjimi.app.main.fragment.MainWebViewFragment;
import cn.jinjimi.app.modules.Resource.Resource;

/**
 *
 * @author zhenhua
 * @date 2018/2/5
 */

public class SimpleProductSearchActivity extends ToolBarCommonActivity {

    @Override
    protected void beforeInitView() {
        setContentView(R.layout.activity_search_web);
    }

    @Override
    protected void initial() {
        setTitle(R.string.search);

        Intent intent = getIntent();
        String q = intent.getStringExtra(Constants.BundleKey.Q);

        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        MainWebViewFragment fragment = new MainWebViewFragment();
        Bundle bundle = new Bundle();
        bundle.putString(Constants.BundleKey.URL,
                String.format(Constants.Route.SEARCH_URL, q));
        fragment.setArguments(bundle);
        ft.replace(R.id.web_fragment_container, fragment);
        ft.commit();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

}
